<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:a="http://xmlns.heustics.org/schema/myelin/0.1/" 
  xmlns:l="http://xmlns.heustics.org/schema/i18n/0.1/"
  exclude-result-prefixes="xsl a l"
> 
  <xsl:variable name="a:lock-l10n" select="a:get-l10n('&a;Document#lock')"/> 
  <xsl:variable name="a:lock-params-l10n" select="$a:lock-l10n/l:context[@name='params']/*"/>    
  <xsl:variable name="a:lock-hints-l10n" select="$a:lock-l10n/l:context[@name='param-hints']/*"/>
    
  <xsl:template match="a:title" mode="a:input-show">
    <xsl:call-template name="a:simple-input-show">
      <xsl:with-param name="read-only" select="1"/>
      <xsl:with-param name="hint"/>
    </xsl:call-template>
  </xsl:template>
    
  <xsl:template match="a:lock" mode="a:input-show">        
    <div class='input text lock'>  
      <div class="key">
        <div>
          <xsl:call-template name="a:label-class-attr"/>
          <span><xsl:value-of select="$a:lock-params-l10n[@key='lock']"/></span>
          <div class="spacer"/>
        </div>        
        <div class='hint'>
          <span/>
          <div class="spacer"/>
        </div>
        <div class="spacer"/>
      </div>      
      <div class='value'>
        <input type="checkbox" name="lock">
          <xsl:if test="@checked">
            <xsl:attribute name="checked">1</xsl:attribute>
          </xsl:if>
        </input>
        <span><xsl:value-of select="$a:lock-hints-l10n[@key='lock']"/></span>
        <div class="spacer"/>
      </div>
      <div class='spacer'/>
    </div>
    <xsl:apply-templates mode="a:input-show"/>
  </xsl:template>
  
  <xsl:template match="a:locked-by" mode="a:input-show">
    <xsl:call-template name="a:agent-input-show">
      <xsl:with-param name="key" select="'locked-by'"/>
      <xsl:with-param name="label" select="$a:lock-params-l10n[@key='locked-by']"/>
      <xsl:with-param name="hint" select="$a:lock-hints-l10n[@key='locked-by']"/>
    </xsl:call-template>
  </xsl:template>
  
  <xsl:template match="a:transitive" mode="a:input-show">        
    <div class='input text transitive'>  
      <div class="key">
        <div>
          <xsl:call-template name="a:label-class-attr"/>
          <span><xsl:value-of select="$a:lock-params-l10n[@key='transitive']"/></span>
          <div class="spacer"/>
        </div>        
        <div class='hint'>
          <span/>
          <div class="spacer"/>
        </div>
        <div class="spacer"/>
      </div>      
      <div class='value'>
        <input type="checkbox" name="transitive"/>
        <span><xsl:value-of select="$a:lock-hints-l10n[@key='transitive']"/></span>
        <div class="spacer"/>
      </div>
      <div class='spacer'/>
    </div>
  </xsl:template>
  
  <xsl:template match="a:submit[@key='commit']">    
    <xsl:param name="name"/>    
    <xsl:param name='key' select='@key'/>
    <xsl:param name="l10n"/>
    <div class="input submit">
      <xsl:variable name='val' select='$l10n[@key="apply"]'/>
      <input type='hidden' name='{$key}' value='{$val}'/>
      <input type='submit' name='{$name}' value='{$val}'/>
      <div class='spacer'/>
    </div>        
  </xsl:template>
  
</xsl:stylesheet>

